Conversation
…tructing the local fs The following warning was logged every time that the local_tgz tar file was successfully decrypted > "local.tgz is encrypted but static decryption failed and no dynamic decryption available!" Now this warning is moved so it only shows when it isn't run on a local target.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1332 +/- ##
==========================================
- Coverage 81.11% 81.06% -0.05%
==========================================
Files 402 402
Lines 35244 35244
==========================================
- Hits 28587 28571 -16
- Misses 6657 6673 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
What's the status of this? |
It needs a review. I made it when I noticed something off during debugging, but it was never picked up afterwards |
|
Fyi I found the same issue while working on #1509 . |
Schamper
left a comment
There was a problem hiding this comment.
Can you add a test to ensure we don't mess this up again?
I adjusted the current tests for this behaviour to check for the log entry |
| with patch("dissect.target.plugins.os.unix.esxi._os.subprocess.run") as mocked_run: | ||
| mocked_run.return_value.stdout = b"data" | ||
|
|
||
| assert _decrypt_crypto_util(fs_unix.path("data")).read() == b"data" |
There was a problem hiding this comment.
Can you assert that the correct log lines show up here
There was a problem hiding this comment.
_detect_crypto_util doesn't log anything, did you mean the test below it? (test_esxi_os_detection)
There was a problem hiding this comment.
Whatever the test is that tests it for the local 😄.
There was a problem hiding this comment.
I changed the names for the tests a bit to reflect what they actually tests and assert the log messages test for:
test__create_local_fs_local_no_envelope
And add assertions for Log messages that occurred
|
I notice there is probably a weird test dependency somewhere with caplog where it doesn't capture any logging for the esxi test. The seed can be reproduced (not only on windows) so I am looking into it. |
configure_logging gets called during the execution of the main of our target tooling. This causes some issues with capturing logging messages with caplog This patch basically does the same as tests/tools/conftest.py::prevent_logging_setup for this specific test
|
@Schamper found the issue that broke the caplog for the test. This also gets rid of the deprecation warning we got from structlog during the test. I'll make a different pr to fix that directly. |
|
#1631 fixes the deprecation warning I mentioned |
The following warning was logged every time that the local_tgz tar file
was successfully decrypted
Now this warning is moved so it only shows when it isn't run on a local
target.